/**
 * HR 月评
 */
import React from 'react';
import BizIcon from '@/components/BizIcon';
import ProjectPreview from '@/pages/TurnoverSetting/containers/ProjectPreview';

function AssessPreview({ children, assessTable }) {
    const [visible, setVisible] = React.useState(false);

    return (
        <div className="preview-sheet">
            {children ? (
                <span onClick={() => setVisible(true)}>{children}</span>
            ) : (
                <BizIcon type="chakanxiangqing" onClick={() => setVisible(true)} />
            )}

            <ProjectPreview
                visible={visible}
                onVisibleChange={setVisible}
                projectName={assessTable?.projectName}
                project={assessTable?.project}
                projectExplain={assessTable?.projectExplain}
            />
        </div>
    );
}

export default AssessPreview;
